#ifndef PLAYLIST_H
#define PLAYLIST_H

#include <QListWidget>
#include <QMouseEvent>
#include <QApplication>
#include <QFileInfo>
#include <QMessageBox>

class PlayList : public QListWidget
{
    Q_OBJECT
public:
    explicit PlayList(QWidget *parent = 0);
    explicit PlayList(QIcon *icon, QWidget *parent = 0);
    ~PlayList();

    void addFile(QString str);
    void addFiles(QStringList *list);

    void setPlayIcon(QIcon *icon);

    QString getSong();
    QString nextSong();
    QString previousSong();

    bool savePlayList(QString filePath);
    bool openPlayList(QString filePath);

    
signals:
    void songActivated(QString filePath);
    
public slots:
    void removeSongs();
    void clear();

protected slots:
    void itemActivated(QListWidgetItem *item);

protected:
    void keyReleaseEvent(QKeyEvent * event);

private:
    QMap<QString, QString> *map;
    QIcon *playIcon;
    QString actualSong;

    void Init();
};

#endif // PLAYLIST_H
